package com.ethan.cj.ssm.util;

import com.ethan.cj.ssm.entity.Content;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

public class JsonUtil {
    public static <T> T parseObject(String contentJson, Class<T> c) {
        T t = null;
        try {
            t = new ObjectMapper().readValue(contentJson, c);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return t;
    }
}
